package gouhuo.allbugs.top.model.enums;

/**
 * 聊天类型枚举
 */
public enum ChatEnum {

    PRIVATE_CHAT(1, "私聊"),
    TEAM_CHAT(2, "群聊");

    private int value;

    private String text;

    public static ChatEnum getEnumByValue(Integer value) {
        if (value == null) {
            return null;
        }
        ChatEnum[] values = ChatEnum.values();
        for (ChatEnum chatEnum : values) {
            if (chatEnum.getValue() == value) {
                return chatEnum;
            }
        }
        return null;
    }

    ChatEnum(int value, String text) {
        this.value = value;
        this.text = text;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

}
